package com.eascs.crm.nsEditDetail.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.eascs.admin.common.controller.BaseMasterViewController;
import com.eascs.admin.o2o.loan.entity.O2oLoanapplyEntity;
import com.eascs.admin.o2o.loan.service.O2oLoanapplyService;
import com.eascs.app.log.Logger;
import com.eascs.app.log.LoggerFactory;
import com.eascs.crm.nsEditDetail.entity.CustomerAssetInfo;
import com.eascs.crm.nsEditDetail.service.CustomerAssetInfoService;
import com.eascs.site.view.ViewContext;

/**
* @author bao.pan 2017年7月12日 下午5:10:28
*/
@Controller
@RequestMapping("/assetView")
public class CustomerAssetInfoController extends BaseMasterViewController{
	private final Logger logger = LoggerFactory.getLogger(CustomerAssetInfoController.class);
	@Autowired
	private CustomerAssetInfoService customerAssetInfoService;
	//xingwang.chen add
	@Autowired
	private O2oLoanapplyService o2oLoanapplyService;

	@RequestMapping(value = "/view", method = RequestMethod.GET)
	public String view(String loanapplyNo) {
		logger.info("查询客户资产信息（旧版本），单款id：【{}】", loanapplyNo);
		CustomerAssetInfo assetInfo = customerAssetInfoService.queryById(loanapplyNo);
		O2oLoanapplyEntity entity = o2oLoanapplyService.findById(loanapplyNo);
		ViewContext.put("assetInfo", assetInfo);
		ViewContext.put("loanapplyNo", loanapplyNo);
		ViewContext.put("loanapply", entity);
		return "nsEditDetail/customer_asset_info_view";
	}
}
